import java.util.Scanner;
public class NGuessNumber {
    public static int[] generateAnswer(){


    int a[] =new int[4];
       do { for (int i = 0; i < 4; i++) {
        int x = (int) (Math.random() * 10);
        int m = 0;
        for (int j = i - 1; j > 0; j--) {
            if (a[j] == x) {
                m = 1;
            }
        }
        if (m != 1) {
            a[i] = x;
        } else {
            i--;
        }
    }
    }while (!((a[0]!=0) && (a[0]!=a[1]) && (a[0]!=a[2]) && (a[0]!=a[3]) && (a[1]!=a[2]) && (a[1]!=a[3]) && (a[2]!=a[3])));
        return a;
}
    public static void main(String[] args) {
        for (int a : NGuessNumber.generateAnswer()) {
            System.out.println(a);
        }
    }    public static int[] getPlayerInput() {
        Scanner sc = new Scanner(System.in);
        int a[]=new int[4];
        for (int i = 0; i <a.length ; i++) {
            System.out.println("请输入第"+(i+1)+"个数字：");
            a[i]=sc.nextInt();
        }
        return a;
    }
    public static boolean isWin(int[] a) {
        return a[0] == 4;
    }


    public static int[] compareGuessAnswer(int[] a, int[] b) {
        int c[] = new int[4];
        c[0]=c[1]=0;
        for (int i = 0; i <c.length ; i++) {
            if (a[i]==b[i]){
                c[1]++;
            }
            for (int j = 0; j <c.length ; j++) {
                if (a[i]==b[j]){
                    c[0]++;
                }
            }
        }
        System.out.println("您猜对了"+c[0]+"个数字.");
        System.out.println("您猜对了"+c[1]+"个位置.");
        return c;
    }
}